home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / COLLECT.PAK / COLLEDOC.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  110 lines

  1. // colledoc.h : interface of the CCollectDoc class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. class CMyStruct
  14. {
  15. // Attributes
  16. public:
  17.     int m_int;
  18.     float m_float;
  19.     CString m_str;
  20.  
  21. // Operations
  22. public:
  23.     void FormatMyStruct(CString& str);
  24. };
  25.  
  26. // Note: in order for the specialization to be accepted by the compiler
  27. //    the prototype for SerializeElements (or any other specialization)
  28. //    must be visible when the template is expanded.    It is best to place
  29. //    these declarations in the header file to avoid any unexpected
  30. //    results.
  31.  
  32. void SerializeElements(CArchive& ar, CMyStruct** ppElements, int nCount);
  33.  
  34. class CMyObject : public CObject
  35. {
  36. public:
  37.     CMyObject();
  38.     DECLARE_SERIAL(CMyObject)
  39.  
  40. // Attributes
  41. public:
  42.     int m_int;
  43.     float m_float;
  44.     CString m_str;
  45.  
  46. // Operations
  47. public:
  48.     void FormatMyObject(CString& str);
  49.  
  50. // Implementation
  51. public:
  52.     virtual ~CMyObject();
  53.     virtual void Serialize(CArchive& ar);
  54. };
  55.  
  56. typedef CTypedPtrList<CPtrList, CMyStruct*> CMyStructList;
  57. typedef CTypedPtrArray<CObArray,CMyObject*> CMyObjectArray;
  58. typedef CTypedPtrMap<CMapStringToOb,CString,CMyObject*> CMapStringToMyObject;
  59. typedef CMap<DWORD,DWORD,CMyStruct*,CMyStruct*&> CMapDWordToMyStruct;
  60.  
  61.  
  62. class CCollectDoc : public CDocument
  63. {
  64. protected: // create from serialization only
  65.     CCollectDoc();
  66.     DECLARE_DYNCREATE(CCollectDoc)
  67.  
  68. // Attributes
  69. public:
  70.     CStringList m_stringList;
  71.     CMyStructList m_mystructList;
  72.     CList<int,int> m_intList;
  73.     CDWordArray m_dwArray;
  74.     CMyObjectArray m_myobArray;
  75.     CArray<CPoint,CPoint> m_ptArray;
  76.     CMapStringToString m_mapStringToString;
  77.     CMapStringToMyObject m_mapStringToMyObject;
  78.     CMapDWordToMyStruct m_mapDWordToMyStruct;
  79.  
  80.  
  81. // Operations
  82.  
  83. // Overrides
  84.     virtual void DeleteContents();
  85.     // ClassWizard generate virtual function overrides
  86.     //{{AFX_VIRTUAL(CCollectDoc)
  87.     protected:
  88.     virtual BOOL OnNewDocument();
  89.     //}}AFX_VIRTUAL
  90.  
  91. // Implementation
  92. public:
  93.     virtual ~CCollectDoc();
  94.     virtual void Serialize(CArchive& ar);   // overridden for document i/o
  95. #ifdef _DEBUG
  96.     virtual void AssertValid() const;
  97.     virtual void Dump(CDumpContext& dc) const;
  98. #endif
  99.  
  100. protected:
  101.  
  102. // Generated message map functions
  103. protected:
  104.     //{{AFX_MSG(CCollectDoc)
  105.     //}}AFX_MSG
  106.     DECLARE_MESSAGE_MAP()
  107. };
  108.  
  109. /////////////////////////////////////////////////////////////////////////////
  110.